package com.hongye.app.model;

import java.util.List;

import com.hongye.util.Utils;
import com.jfinal.plugin.activerecord.Model;
/**
 * 意见反馈
 * @author liushaomin
 */
public class FeedBackModel extends Model<FeedBackModel>{

	private static final long serialVersionUID = -380258080842271167L;
	public static final FeedBackModel dao = new FeedBackModel();
	/**
	 * 添加意见和建议
	 * @author liushaomin
	 * 2017年3月10日
	 * @param phone
	 * @param content
	 * @return
	 */
	public static boolean add(String phone, String content){
		return new FeedBackModel().set("phone", phone).set("content", content).set("c_time", Utils.getDate()).save();
	}
	
	/**
	 * 获取意见和建议的列表
	 * @author lifuqiang
	 * 2017-3-10
	 */
	public List<FeedBackModel> getlist(){
		String sql = "select * from feedback order by c_time desc";
		List<FeedBackModel> list  = dao.find(sql);
		return list;
	}
}
